/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import dao.PrivilegeDAO;
import entity.Privilege;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import org.jboss.weld.context.ejb.Ejb;

/**
 *
 * @author linos
 */
@ManagedBean(name="privilegeBean")
@RequestScoped
public class PrivilegeBean {
        
    @Ejb
    private PrivilegeDAO privilegeDAO=new PrivilegeDAO();
    private Privilege privilege;
    private List<Privilege> privileges;
    public PrivilegeBean() {
    }

    public PrivilegeDAO getPrivilegeDAO() {
        return privilegeDAO;
    }

    public void setPrivilegeDAO(PrivilegeDAO PrivilegeDAO) {
        this.privilegeDAO = PrivilegeDAO;
    }

    public Privilege getPrivilege() {
        return privilege;
    }

    public void setPrivilege(Privilege Privilege) {
        this.privilege = Privilege;
    }

    public List<Privilege> getPrivileges() {
            System.out.println("PrivilegeDAO.findAll();"+privilegeDAO.findAll().size());
        return privilegeDAO.findAll();
    }

    public void setPrivileges(List<Privilege> Privileges) {
        this.privileges = Privileges;
    }
}
